package sensorgui;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * Holds the contents and location of a single square in the grid.
 * Each square can hold 0..1 ExclusiveObject (e.g. a VacBot) 
 * and 0..* non-exclusive GhostObjects (e.g. a piece of Dust).
 */
public class Square {

	// Maintain a thread-safe stack of GhostObjects
	private final GridPoint location;
	
	/**
	 * Simple constructor to make each SquareContents instance aware of its location
	 * @param location This square's location on the grid
	 */
	public Square(GridPoint location) {
		this.location = location;
	}
	
	public GridPoint getLocation() {
		return location;
	}
	
		
	/**
	 * Test if this square is occupied by a non-permanent (Movable) object.
	 * @return true if the square is occupied, otherwise false.
	 */
	public boolean isOccupied() {
		return false;
	}
	
	
	
	/**
	 * Returns a count of the ghost and exclusive objects currently occupying this square.
	 * @return the total number of objects in this square
	 */
	public synchronized int getCount() {
		int count = 0;
		return count;
	}
	
	// Return a short string description of this square's location and contents
	public String toString() {
		boolean separator = false;
		String s = "Square " + location + ":";
		
		return s;
	}
	
	
}
